Graphics operations normally occur in a Canvas window item. Most graphics in Prograph rely on Macintosh Toolbox calls; see chapter 7, “The Macintosh Toolbox.”
Some primitives are provided, however, to simplify certain common tasks. Many of these primitives use the Macintosh types Point and Rect, which have textual representations in Prograph as {<vertical> <horizontal>} and {<top> <left> <bottom> <right>} respectively.
_________________________________________________
 
drag-rect *276*
Input types: Canvas; Rect; Point; MacConstant
Output types: Rect
Description: Drags a dotted outline of OldRect within aCanvas following the movement of the mouse, until the mouse button is released, when the outlined rectangle becomes NewRect. The value of Mouse must be within the bounds of OldRect. Restrict must be one of noConstraint, hAxisOnly, or vAxisOnly, which respectively indicate that dragging is unrestricted, horizontal, or vertical.
Note: drag-rect does its own calls to begin-drawing and end-drawing, so it should be called outside the user’s calls to those routines.
Description: Instance is the first instance after position StartIndex in aList with an attribute AttributeName, the value of which is a rectangle containing aPoint. FoundIndex is the position of Instance in aList. If no such instance exists, FoundIndex and Instance are 0 and NULL respectively.
See also: find-instance
_________________________________________________
 
grow-rect *277*
Input types: Canvas; Rect; Point; MacConstant
Output types: Rect
Description: Produces a modified dotted outline of OldRect within aCanvas following the movement of the mouse, until the mouse button is released, when the outlined rectangle becomes NewRect. The value of Mouse must be within the bounds of OldRect. Restrict must be one of noConstraint, hAxisOnly, or vAxisOnly, which indicate respectively that resizing is unrestricted, horizontal, or vertical.
Note: grow-rect does its own calls to begin-drawing and end-drawing, so it should be called outside the user’s calls to those routines.
See also: drag-rect
_________________________________________________
 
ints-to-point *277*
Input types: integer; integer
Output types: Point
Description: APoint is the point {Vertical Horizontal}.
See also: point-to-ints, ints-to-rect
_________________________________________________
 
ints-to-rect *278*
Input types: integer; integer; integer; integer
Output types: Rect
Description: ARect is the rectangle {Top Left Bottom Right}.
See also: rect-to-ints, ints-to-point
_________________________________________________
 
ints-to-rgb *278*
Input types: integer; integer; integer;
Output types: RGBColor
Description: Takes Red, Green, and Blue values and converts them to an RGBColor.
See also: rgb-to-ints
_________________________________________________
 
point-to-ints *278*
Input types: Point
Output types: integer; integer
Description: Vertical and Horizontal are the vertical and horizontal coordinates of aPoint, respectively.
See also: ints-to-point, points-to-rect
_________________________________________________
 
points-to-rect *279*
Input types: Point; Point
Output types: Rect
Description: ARect is the rectangle, the top left and bottom right corners of which are the points TopLeft and BottomRight, respectively.
Example: A framed rectangle.
 
See also: rect-to-points, point-to-ints
_________________________________________________
 
rect-to-ints *279*
Input types: Rect
Output types: integer; integer; integer; integer
Description: Top, Left, Bottom, Right are respectively the coordinates of the top, left, bottom, and right of aRect.
See also: ints-to-rect, rect-to-points
_________________________________________________
 
rect-to-points *280*
Input types: Rect
Output types: Point; Point
Description: TopLeft and BottomRight are the points at the top left and bottom right corners of aRect, respectively.
See also: points-to-rect, rect-to-ints
_________________________________________________
 
rgb-to-ints *280*
Input types: RGBColor
Output types: integer; integer; integer
Description: Takes an RGBColor and converts it to corresponding Red, Green, and Blue values.